﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using org.alex.edss.Security;

namespace testcrytol
{
    class Program
    {
        static void Main(string[] args)
        {
            string Src = "i am source string O(∩_∩)O哈！";
            Console.WriteLine("Original string is ：" + Src);

            string Key = "12345678"; 

            byte[] Data = Encoding.UTF8.GetBytes(Src);

            byte[] Tar = DES.GetTransfer().Encrypto(Data, Key);

            string b64 = Convert.ToBase64String(Tar);

            Console.WriteLine("Encrypto string is ：" + b64);

            byte[] Ori = DES.GetTransfer().Decrypto(Tar, Key);

            string utf8 = Encoding.UTF8.GetString(Ori);

            Console.WriteLine("Decrypto string is ：" + utf8);

            Console.WriteLine((byte)'\r');

            Console.WriteLine((byte)'\n');

            Console.Read();

        }
    }
}
